using System;
using DotNetXmlSwfChart;
using NUnit.Framework;

namespace DotNetXmlSwfChart.UnitTest
{
    [TestFixture]
    public class AxisCategoryFixture
    {
        [Test]
        public void LineChartToSourceXml()
        {
            string testSourceXml =
                "<axis_category skip='1' " +
                               "font='Arial' " +
                               "bold='True' " +
                               "size='10' " +
                               "color='000000' " +
                               "alpha='12' " +
                               "orientation='horizontal' " +
                               "margin='False' />";
            AxisCategory ac = new AxisCategory(XmlSwfChartType.Line);
            ac.Skip = 1;
            ac.Font = "Arial";
            ac.Bold = true;
            ac.Size = 10;
            ac.Color = "000000";
            ac.Alpha = 12;
            ac.Orientation = "horizontal";
            ac.Margin = false;
            Assert.AreEqual(testSourceXml, ac.ToSourceXML());
        }

        [Test]
        public void AreaChartToSourceXml()
        {
            string testSourceXml =
                "<axis_category skip='1' " +
                               "font='Arial' " +
                               "bold='True' " +
                               "size='10' " +
                               "color='000000' " +
                               "alpha='12' " +
                               "orientation='horizontal' " +
                               "margin='False' />";
            AxisCategory ac = new AxisCategory(XmlSwfChartType.Area);
            ac.Skip = 1;
            ac.Font = "Arial";
            ac.Bold = true;
            ac.Size = 10;
            ac.Color = "000000";
            ac.Alpha = 12;
            ac.Orientation = "horizontal";
            ac.Margin = false;
            Assert.AreEqual(testSourceXml, ac.ToSourceXML());
        }

        [Test]
        public void AreaStackedChartToSourceXml()
        {
            string testSourceXml =
                "<axis_category skip='1' " +
                               "font='Arial' " +
                               "bold='True' " +
                               "size='10' " +
                               "color='000000' " +
                               "alpha='12' " +
                               "orientation='horizontal' " +
                               "margin='False' />";
            AxisCategory ac = new AxisCategory(XmlSwfChartType.AreaStacked);
            ac.Skip = 1;
            ac.Font = "Arial";
            ac.Bold = true;
            ac.Size = 10;
            ac.Color = "000000";
            ac.Alpha = 12;
            ac.Orientation = "horizontal";
            ac.Margin = false;
            Assert.AreEqual(testSourceXml, ac.ToSourceXML());
        }

        [Test]
        public void ScatterChartToSourceXml()
        {
            string testSourceXml =
                "<axis_category skip='1' " +
                               "font='Arial' " +
                               "bold='True' " +
                               "size='10' " +
                               "color='000000' " +
                               "alpha='12' " +
                               "orientation='horizontal' " +
                               "min='0' " +
                               "max='2.5' " +
                               "steps='1' " +
                               "prefix='' " +
                               "suffix='' " +
                               "decimals='0' " +
                               "decimal_char='' " +
                               "separator='' " +
                               "/>";
            AxisCategory ac = new AxisCategory(XmlSwfChartType.Scatter);
            ac.Skip = 1;
            ac.Font = "Arial";
            ac.Bold = true;
            ac.Size = 10;
            ac.Color = "000000";
            ac.Alpha = 12;
            ac.Orientation = "horizontal";
            ac.Min = 0.0F;
            ac.Max = 2.5F;
            ac.Steps = 1;
            ac.Prefix = "";
            ac.Suffix = "";
            ac.Decimals = 0;
            ac.DecimalChar = "";
            ac.Separator = "";
            Assert.AreEqual(testSourceXml, ac.ToSourceXML());
        }
    }
}
